package com.yupi.springbootinit.datasource;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.springbootinit.model.entity.Picture;
import com.yupi.springbootinit.service.PictureService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author njy
 * @date 2023/5/2 19:51
 */
@Service
@Slf4j
public class PictureDataSource implements DataSource{

    @Autowired
    private PictureService pictureService;

    @Override
    public Page doSearch(String searchText, long pageNum, long pageSize) {
        //图片
        Page<Picture> picture = pictureService.searchPicture(searchText, pageNum, pageSize);
        return picture;
    }
}
